package com.briup.cms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.briup.cms.bean.Slideshow;
import com.briup.cms.dao.SlideshowDao;
import com.briup.cms.service.ISlideshowService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author briup
 * @since 2023-11-14
 */
@Service
public class SlideshowServiceImpl extends ServiceImpl<SlideshowDao, Slideshow> implements ISlideshowService {
    @Autowired
    private SlideshowDao slideshowDao;

    public List<Slideshow> selAll() {
        List<Slideshow> slideshows = slideshowDao.selectList(null);
        return slideshows;
    }

    public List<Slideshow> sel() {
        LambdaQueryWrapper<Slideshow> ln=new LambdaQueryWrapper();
        ln.le(Slideshow::getId,1);
        List<Slideshow> list=slideshowDao.selectList(ln);
        return list;
    }
    public IPage<Slideshow> selOne(){
        IPage<Slideshow> iPage=new Page<>(1,10);
        IPage<Slideshow> list = slideshowDao.selectPage(iPage,null);
        return list;
    }
}
